import 'package:chi_med_det_flutter/answer_list.dart';
import 'package:chi_med_det_flutter/login_page.dart';
import 'package:chi_med_det_flutter/main_page.dart';
import 'package:chi_med_det_flutter/signup_page.dart';
import 'package:chi_med_det_flutter/userinfo.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (BuildContext context) => UserInfo()),
        ChangeNotifierProvider(create: (BuildContext context) => AnswerList()),
      ],
      child: MaterialApp(
        title: 'ChiMedDet',
        theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        ),
        home: LoginPage(),
        routes: <String, WidgetBuilder>{
          '/login': (BuildContext context) => LoginPage(),
          '/signup':(BuildContext context) => SignupPage(),
          '/main': (BuildContext context) => const MainPage(),
        },
      ),
    );
  }
}
